<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
    <title>任务管理</title>
    <meta name="decorator" content="default"/>
    <script type="text/javascript">
        $(document).ready(function() {
            //$("#name").focus();
            $("#inputForm").validate({
                submitHandler: function(form){
                    loading('正在提交，请稍等...');
                    form.submit();
                },
                errorContainer: "#messageBox",
                errorPlacement: function(error, element) {
                    $("#messageBox").text("输入有误，请先更正。");
                    if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
                        error.appendTo(element.parent().parent());
                    } else {
                        error.insertAfter(element);
                    }
                }
            });
        });
    </script>
</head>
<body>
    <ul class="nav nav-tabs">
        <li><a href="${ctx}/task/">任务列表</a></li>
        <li class="active"><a href="${ctx}/task/form?id=${task.id}">任务${not empty task.id?'修改':'添加'}</a></li>
    </ul><br/>
    <form:form id="inputForm" modelAttribute="task" action="${ctx}/task/save" method="post" class="form-horizontal">
        <form:hidden path="id"/>
        <sys:message content="${message}"/>     

        <div class="control-group">
            <label class="control-label">任务类型：</label>
            <div class="controls">
                <form:select path="program" class="input-medium">
                    <form:options items="${fns:getDictList('TASK_TYPE')}" itemLabel="label" itemValue="code" htmlEscape="false"/>
                </form:select>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">任务名称：</label>
            <div class="controls">
                <form:input path="taskName" htmlEscape="false" class="input-xlarge "/>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">任务图片:</label>
            <div class="controls">
                <form:hidden id="nameImage" path="showImage" htmlEscape="false" maxlength="255" class="input-xlarge"/>
                <sys:ckImage input="nameImage" type="images" uploadPath="/cms/site"/>
            </div>
        </div>

        <div class="control-group">
            <label class="control-label">任务美币：</label>
            <div class="controls">
                <form:input path="exp" htmlEscape="false" class="input-xlarge "/>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">任务开始日期：</label>
            <div class="controls">
                <input name="startTime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate required"
                    value="${task.startTime}"
                    onclick="WdatePicker({dateFmt:'yyyyMMdd',isShowClear:false});"/>
                <span class="help-inline"><font color="red">*</font> </span>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">任务结束日期：</label>
            <div class="controls">
                <input name="endTime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate required"
                    value="${task.endTime}"
                    onclick="WdatePicker({dateFmt:'yyyyMMdd',isShowClear:false});"/>
                <span class="help-inline"><font color="red">*</font> </span>
            </div>
        </div>

        <div class="control-group">
            <label class="control-label">原始地址：</label>
            <div class="controls">

                <form:textarea  path="link" htmlEscape="false" rows="6" maxlength="1024" class="input-xlarge "/>                

               
            </div>
        </div>
        <div class="control-group">
            <label class="control-label">抓取地址：</label>
            <div class="controls">

                <form:textarea  path="showLink" htmlEscape="false" rows="6" maxlength="1024" class="input-xlarge "/>                

               
            </div>
        </div>
        <div class="form-actions">
            <input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;
            <input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
        </div>
    </form:form>
</body>
</html>